const handleNeedLogin = (fontChange = false) => {
  uni.showModal({
    content: '请先登录！',
    cancelText: "取消", // 取消按钮的文字  
    confirmText: "确认", // 确认按钮的文字  
    showCancel: true, // 是否显示取消按钮，默认为 true
    success: (res) => {
      if (res.confirm) {
        console.log(" uni.getStorageSync('fontsizeChange')", uni.getStorageSync('fontsizeChange'))
        let isReadPrivate = uni.getStorageSync('isReadPrivate');
        let savedPhoneNumbers = uni.getStorageSync('savedPhoneNumbers')
        let apiEnv = uni.getStorageSync('apiEnv');
        uni.clearStorageSync();
        uni.setStorageSync('fontsizeChange', fontChange)
        if (apiEnv) {
          uni.setStorageSync('apiEnv', apiEnv);
        }
        if (isReadPrivate) {
          uni.setStorageSync('isReadPrivate', isReadPrivate)
        }
        if (savedPhoneNumbers && Array.isArray(savedPhoneNumbers) && savedPhoneNumbers.length) {
          uni.setStorageSync('savedPhoneNumbers', savedPhoneNumbers)
        }
        uni.reLaunch({
          url: '/pages/login/login'
        })
        console.log('comfirm') //点击确定之后执行的代码
      } else {
        console.log('cancel') //点击取消之后执行的代码
      }
    }
  })
}
export default {
  handleNeedLogin
}